home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9056 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  615 b 

  1. Path: newsbf02.news.aol.com!not-for-mail
  2. From: mrdavc@aol.com (Mrdavc)
  3. Newsgroups: comp.lang.c++
  4. Subject: Copying Variables ???
  5. Date: 28 Feb 1996 02:02:17 -0500
  6. Organization: America Online, Inc. (1-800-827-6364)
  7. Sender: root@newsbf02.news.aol.com
  8. Message-ID: <4h0ulp$i7g@newsbf02.news.aol.com>
  9. Reply-To: mrdavc@aol.com (Mrdavc)
  10.  
  11. Why doesn't the following replacement work?  and how should the code be
  12. corrected?
  13.  
  14. works:
  15.     fputc(fgetc(in), out);
  16.  
  17. doesn't work:
  18.     char2trans = fgetc(in);
  19.     newchar = char2trans;
  20.     fputc(newchar, out);
  21.  
  22. char2trans and newchar are defined as unsigned int which is what fgetc(in)
  23. returns.
  24.